The present invention relates to a rendering process for displaying three-dimensional image information on a two-dimensional screen, such as on a television monitor, a device used therefor, a recording medium having recorded thereon an image rendering program, and such image rendering program.
There are accelerating trends in higher integration and faster processing speed of processors and memories in recent television game consoles and personal computers, so that an image rendering device composed of such a game console or personal computer can generate, from three-dimensional image information, fine two-dimensional images with real presence in a real-time manner and can display them on two-dimensional monitor screens.
When a three-dimensional image is rendered on a two-dimensional monitor screen, the image rendering device subjects three-dimensional polygon data to various geometry processing, such as coordinate conversion, clipping and lighting, and further subjects the resultant data to transparent projection conversion. The image rendering device also pastes textures having various colors and patterns onto polygons to thereby give desired colors and patterns to the objects. Such pasting of textures onto polygons is generally referred to as texture mapping.
By employing a rendering technique described below, the image rendering device can generate a so-called specular image, which is an image expressing a water surface or the like having a light source caught thereon. To prepare a specular image, the image rendering device first sets R, G and B values for the individual apexes of polygons in an area where the light source will be caught. The image rendering device then performs linear interpolation between the brightness of adjacent apexes through processing such as so-called flat shading or Gouraud shading.
According to such rendering technique, R, G and B values will change in a linear manner between adjacent apexes of polygons, and adjacent polygons may have considerably different brightnesses. It is therefore difficult to express a natural specular image with such rendering technique.
The image rendering device may employ another rendering technique to generate a specular image having a light source caught on a water surface and so forth. The image rendering device in this case has stored therein as many textures as possible which are previously prepared in order to handle variations in the brightness of the light source or colors. The image rendering device finds R, G and B values for the individual apexes of polygons based on normal line vectors of the polygon apexes, line-of-sight vectors, the direction of the light source, and the color and brightness of the light source, and performs texture mapping corresponding to the thus obtained R, G and B values. Such rendering technique is advantageous in that it ensures a more natural expression, for example, of the sun or moon caught on the water surface as compared with the foregoing rendering technique.
This rendering technique is, however, disadvantageous in that it needs a vast number of textures so as to handle wide variations in the brightness of the light source or color.
Assuming now that the light source is the sun or moon, the actual sun or moon looks different in color or brightness depending on its altitude from the ground (i.e., elevation angle) and the weather conditions (clear, slightly cloudy, humidity in the air, airborne dust). The apparent color and brightness of the sun or moon also vary with time due to travel of such heavenly bodies (i.e., apparent movement due to the autorotation of the earth). Therefore, in order to achieve a more natural expression of the sun or moon caught on the water surface, the image rendering device should preliminarily prepare and store a huge number of textures capable of expressing all colors and brightnesses which correspond to the altitude or weather conditions and which vary with time. Moreover, reflectivity on the water surface can vary depending on the incident angle of light coming onto the water surface and the angle of reflection of light reflected from the water surface, that is, depending on the angle of line-of-sight away from the water surface. This also causes a drastically increased number of textures that the image rendering device should prepare and store in order to express all variations of such reflectivity.
The present invention was proposed to address the foregoing problems, and an object thereof resides in providing an image rendering method especially capable of achieving more natural expression of the sun or moon caught on the surface of water without preparing a huge number of textures, and also resides in providing a device used therefor, a recording medium having recorded thereon an image rendering program, and such image rendering program.
According to the present invention, parameters corresponding to at least the color or brightness of a polygon to be rendered are added to apex information of such polygon, and based on such parameters an address for referencing a two-dimensional coordinate corresponding to each pixel composing such polygon is generated. Color and/or brightness values corresponding to the address are then acquired and assigned to the individual pixels, where the table contains color and brightness values at positions specified by two-dimensional coordinates, such color values being aligned so as to express a gradation of color tone along one coordinate axis of such two-dimensional coordinates, and such brightness values being aligned so as to express a gradation of brightness along the other coordinate axis of such two-dimensional coordinates. The table is typically provided as a texture.
In other words, the present invention sets color and brightness values of a polygon in which a light source will be caught by acquiring color and brightness values of the individual pixels from a table based on two-dimensional coordinate values added to the apex information of such polygon. The present invention is successful in rendering a polygon having a light source caught thereon by using such table as a texture, which is attainable by a process similar to the general texture mapping without the need for special processing.
Other and further objects and features of the present invention will become obvious upon an understanding of the illustrative embodiments about to be described in connection with the accompanying drawings or will be indicated in the appended claims, and various advantages not referred to herein will occur to one skilled in the art upon employing the invention in practice.